Objects Reference

class anim_mesh : public mesh

Definition

class anim_mesh : public mesh
{
  public:
  int nframes,texpic;
  vector *ao_vert;
  vector *ao_bbox;
  int nstripfan,nstripfanvert,*stripfancount,*stripfanvert;
  vertex *vertdata;

  anim_mesh()
  {
    ao_vert=0;
    ao_bbox=0;
    nframes=0;
    nstripfan=0;
    nstripfanvert=0;
    stripfancount=0;
    stripfanvert=0;
    vertdata=0;
    texpic=-1;
  }

  void reset();
  void compute_bbox();
  int load_fao(char *name);
  void set_key(float key);
  void set_key(int key);
  void draw();

  virtual ~anim_mesh()
  { reset(); };
};

Data Members

Member Type Description
nframes int number of key frames in animation
texpic int the texture picture applied to the mesh
ao_vert vector * keyframe vertices (nv*sizeof(vector)*nframes)
ao_bbox vector * keyframe bounding boxes (nframes*2*sizeof(vector))
nstripfan int number of strips/ans
nstripfanvert int number of vertices in strip/fan vertex array
stripfancount int * strip/fan vertex count array (nstripfan*sizeof(int))
stripfanvert int * vertex indices into ao_vert (nstripfanvert*sizeof*(int))
vertdata vertex * strip/fan vertex array (nstripfanvert*sizeof(vertex))

Methods

reset, compute_bbox, load_fao, set_key, draw

Remarks

This class implements an animated mesh. The mesh animation is defined by keyframes and each keyframe if made of an array of vertex positions. The mesh can be represented by a group of strip/fans or just the separate triangles. The complete mesh must have a single texture and to interpolate the animation, use the set_key function. 

See Also

vector, mesh